//3_7
// displays count value  0 and 1 in string
#include<iostream>
#include<string>
int n_count( std::string, char );

int main()
{
	std::string txt;
	std::cout << "Enter text: ";
	std::getline( std::cin, txt );
	std::cout << "count 0: " << n_count( txt, '0') << "\tcount 1: " << n_count( txt, '1') << std::endl;
	return 0;
}
int n_count( std::string str, char ch)
{
	int count = 0;
	for( int i=0; i<str.length(); ++i)
	{
		if( ch == str[i] ) {
			++count;
		}
	}
	return count;
}